#ifndef _RENZO_POLYGON_GROUP_
#define _RENZO_POLYGON_GROUP_

#include "RenzoMustHave.h"
#include "RenzoPrimitiveGroup.h"
#include "RenzoVertex.h"
#include "RenzoFace.h"

namespace Renzo
{
class PolygonGroup : public PrimitiveGroup
{
protected:
	PolygonGroup(void);
	static Object* create();
	virtual ~PolygonGroup(void);
	friend class ResourceManager;

public:
	void addVertex(Vertex* v);
	void addFace(Face* f);
	void setTexture(Texture* t);
	const Texture* getTexture() const;
	void setMaterial(Material* m);
	const Material* getMaterial() const; 

	void transform(const Matrix4& mat);
	void update(int delta);
	void render();

	BoundingBox* getBoundingBoxAABB();
protected:
	typedef std::vector<Vertex*> VertexList;
	VertexList vertices;
	
	typedef std::vector<Face*> FaceList;
	FaceList faces;

	Texture* texture;
	Material* material;
};
}

#endif